import { messages } from "share/common";
import React, { Component } from "react";
import { Button, Icon } from "antd";
import SVGIcon from "components/SVGIcon";
class RowCardHeader extends Component {
  constructor(props) {
    super(props);
  }

  render() {
    const { addText, notice, onNotice, onAdd, onCollapsed, header, search, onSearch, addButtonProps = {} } = this.props;
    return (
      <div className="row-card-header">
        <div className="header-fixed">
          <div className="header-fixed-left">
            <Button {...{ type: "primary", onClick: { onAdd }, ...addButtonProps }}>
              {addText || messages("common-1.key1404") /*+ 新增按键*/}
            </Button>
            {notice && (
              <span className="row-card-span" onClick={onNotice}>
                {notice}
              </span>
            )}
          </div>
          <div className="header-fixed-right">
            {search && <SVGIcon className="" type="table-filter" onClick={onSearch} />}
            <Icon type="menu-fold" onClick={onCollapsed} />
          </div>
        </div>
        <div className="header-button">{header}</div>
      </div>
    );
  }
}

export default RowCardHeader;
